import Cookies from 'js-cookie'

const TokenKey = 'token'
const Location = 'location'

// const Domain = 'localhost' // 开发环境
const Domain = 'webuilding.net.cn' // 生产环境

export function getToken () {
  return Cookies.get(TokenKey)
}
export function getUsername () {
  return Cookies.get('username')
}

export function getBuildingname () {
  return Cookies.get('buildingname')
}
export function getPhone () {
  return Cookies.get('phone')
}

export function setLocation () {
  return Cookies.set(Location, 'bim', {domain: Domain})
}

export function removeToken () {
  return Cookies.remove(TokenKey, {domain: Domain})
}
export function removeUsername () {
  return Cookies.remove('username', {domain: Domain})
}
export function removeBuildingname () {
  return Cookies.remove('buildingname', {domain: Domain})
}
export function removePhone () {
  return Cookies.remove('phone', {domain: Domain})
}
